package com.drg.center.service.impl;

import com.drg.center.dao.SysDoctorGroupDAO;
import com.drg.center.entity.SysDoctorGroupPO;
import com.drg.center.entity.result.DoctorGroupVO;
import com.drg.center.service.SysDoctorGroupService;
import com.guaike.core.entity.result.Result;
import com.guaike.core.utils.ListUtil;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
@AllArgsConstructor
public class SysDoctorGroupServiceImpl implements SysDoctorGroupService {

    private final SysDoctorGroupDAO sysDoctorGroupDAO;

    @Override
    public Result<List<DoctorGroupVO>> list(String keyword) {
        List<SysDoctorGroupPO> pos = sysDoctorGroupDAO.findList(keyword);
        List<DoctorGroupVO> vos = ListUtil.copyList(pos, DoctorGroupVO.class);
        return Result.success().data(vos).build();
    }
}
